package com.demo.demo.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.web.ErrorController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.demo.demo.exception.NotFoundException;

import springfox.documentation.annotations.ApiIgnore;

/**
 * 
 * <p>classname:ErrorController</p>
 * <p>Description:</p>
 * <p>Company:斯润天朗</p>
 * @author guogw
 * @version V2.0
 * @date 2017年10月24日 下午10:12:50
 */
@RestController
@ApiIgnore
@RequestMapping(value = "/error")
public class BaseErrorController  implements ErrorController{
	
	private static final Logger logger = LoggerFactory.getLogger(BaseErrorController.class);
	
	@Override
	@RequestMapping
	public String getErrorPath() {
		logger.info("出错啦！进入自定义错误控制器");
		throw new NotFoundException("请检查接口是否正确");
	}

}
